package com.apanal.qlife.personal.service.impl;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.apanal.qlife.common.constants.Constants;
import com.apanal.qlife.common.page.Page;
import com.apanal.qlife.common.page.PageReturn;
import com.apanal.qlife.personal.service.FeedBackService;
import com.apanal.qlife.property.dao.JoinusMapper;
import com.apanal.qlife.property.model.Joinus;
import com.apanal.qlife.sys.dao.FeedbackMapper;
import com.apanal.qlife.sys.model.Feedback;
@Service
public class FeedBackServiceImpl implements FeedBackService {

	@Autowired
	FeedbackMapper mapper;
	
	@Autowired
	JoinusMapper  joinusMapper;
	@Override
	public String insert(Feedback feedBack) {
		 mapper.insert(feedBack);
		return Constants.DEFAULT_MSG_SUCCESS;
	}

	@Override
	public PageReturn<Feedback> findAppfdList(Feedback feedback, Page page) {
		int count = mapper.selectAppfdForPageCount(feedback, page);
		   List<Feedback> list = mapper.selectAppfdForPage(feedback, page);
		 
		return new PageReturn<Feedback>(list, count, page, feedback);
	}

	@Override
	public PageReturn<Joinus> findAppContractList(Joinus joinus, Page page) {
		int count = joinusMapper.selectAppContractForPageCount(joinus, page);
		   List<Joinus> list = joinusMapper.selectAppContractForPage(joinus, page);
		return new PageReturn<Joinus>(list, count, page, joinus);
	}



}